<template>
  <div class="carousel-btn" @click="gotoPorject" :style="{backgroundImage:'url(' + imgGo + ')'}">{{project}}</div>
</template>
<script>
import imgGo from "./go.png"
export default {
  props:{
    project:{
      type:String,
      default:"去看项目"
    },
    path:{
      type:String,
      default:'/demo'
    }
  },
  data(){
    return {
      imgGo
    }
  },
  methods:{
    gotoPorject(){
      this.$router.push(this.path)
      this.$store.commit('changeActiveIndex',this.path)
      // this.$store.dispatch('xxx',data)
    }
  },
}
</script>
<style>
 .carousel-btn{
    width: 140px;
    height: 30px;
    background-size: 140px 30px;
    background-repeat: no-repeat;
    background-position: center center;
    font-size: 15px;
    display: flex;
    align-items: center;
    padding-left: 20px;
    margin-top: 40px;
    color: #fff;
  }
  .carousel-btn:hover{
    cursor: pointer;
  }
</style>